﻿using System;
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using Sustainalytics.ClientDW.Entities;
using Sustainalytics.ScreeningTool.Synchronization.Handlers;
using Xunit;

namespace Sustainalytics.ScreeningTool.Synchronization.Tests.Handlers.Type7GCOverallCompanySummaryExtendedHandlerTests
{
    [Trait("Category", "Unit")]
    public class JoinStringPrinciplesAbbr_Should
    {
        [Fact]
        public void return_null_if_principles_sequence_is_null()
            => ((GCPrincipleTemplate[])null).JoinStringPrinciplesAbbr(";").Should().Be(null);

        [Fact]
        public void return_concatenated_principles()
        {
            var principles = new GCPrincipleTemplate[]
            {
                new GCPrincipleTemplate { Id = 1 },
                new GCPrincipleTemplate { Id = 2 },
            };

            var expected = "P1;P2";

            principles.JoinStringPrinciplesAbbr(";").Should().Be(expected);
        }
    }
}
